/*
	File:		IGraphics.h
	Author:		dmonroe
	Date:		10/14/2012
	Copyright:	Full Sail University

	Purpose:	Interface class for graphics implementations
*/

#ifndef IGRAPHICS_H
#define IGRAPHICS_H


// Uses SGD::CHandle for referencing assets
#include "../source/SGD_Handle.h"

// Uses SColor for blending
#include "../source/Color.h"

// Forward declaration
struct SRect;


class IGraphics
{
public:
	// SINGLETON
	static IGraphics*	GetInstance		( void );
	static void			DeleteInstance	( void );

	// SETUP
	virtual	bool		Initialize		( const char* title, unsigned short& width, unsigned short& height )	= 0;
	virtual	bool		Terminate		( void )	= 0;
	
	// FRAME UPDATE
	virtual bool		Update			( void )	= 0;
	virtual bool		BeginScene		( void )	= 0;
	virtual bool		EndScene		( void )	= 0;


	// 2D	NOTE:		OpenGL does not support color key transparency. Would have to iterate through raw texture data. :(
	virtual HTexture	LoadTexture			( const char* filename )	= 0;
	virtual bool		UnloadTexture		( HTexture handle )	= 0;

	virtual bool		DrawTexture			( HTexture handle,			int x, int y, 
											  float rotation = 0.0f,	float rotationPointX = 0.0f,	float rotationPointY = 0.0f, 
											  SColor color = SColor(),	float scaleX = 1.0f,			float scaleY = 1.0f )		= 0;
	
	virtual bool		DrawTextureSection	( HTexture handle,			int x, int y,					SRect* section,
											  float rotation = 0.0f,	float rotationPointX = 0.0f,	float rotationPointY = 0.0f, 
											  SColor color = SColor(),	float scaleX = 1.0f,			float scaleY = 1.0f )		= 0;
	
	virtual bool		DrawRectangle		( SRect* rectangle,
											  float rotation = 0.0f,	float rotationPointX = 0.0f,	float rotationPointY = 0.0f, 
											  SColor color = SColor(),	float scaleX = 1.0f,			float scaleY = 1.0f )		= 0;
	
	virtual bool		DrawLine			( int x1, int y1,			int x2, int y2,
											  SColor color = SColor(),	float width = 1.0f,				bool smooth = true )		= 0;


	// SHADERS?


protected:
	IGraphics			( void )		// Default constructor
		{	/* do nothing*/		}
	virtual	~IGraphics	( void )		// Destructor
		{	/* do nothing*/		}

private:
	IGraphics				( const IGraphics& );	// Copy constructor
	IGraphics&	operator=	( const IGraphics& );	// Assignment operator

};

#endif //IGRAPHICS_H
